#include "TFGameMoveList.h"

TFGameMoveList::TFGameMoveList()
{
	_gameMoveList.clear();
}

TFGameMoveList::~TFGameMoveList()
{
	//destructor
	_gameMoveList.clear();
}

void TFGameMoveList::Add(TFGameMove &iGameMove)
{
	_gameMoveList.push_back(iGameMove);
}

void TFGameMoveList::RemoveEnd()
{
}

void TFGameMoveList::Reset()
{
	_gameMoveList.clear();
}

int TFGameMoveList::Size()
{
	return _gameMoveList.size();
}

void TFGameMoveList::Get(int iIndex, TFGameMove &oGameMove)
{
	oGameMove = _gameMoveList[iIndex];
}

bool TFGameMoveList::IsInList(TFGameMove &iGameMove)
{
	for(int i = 0; i < _gameMoveList.size(); i++)
	{
		if(_gameMoveList[i]._x1 == iGameMove._x1 &&
		   _gameMoveList[i]._y1 == iGameMove._y1 &&
		   _gameMoveList[i]._x2 == iGameMove._x2 &&
		   _gameMoveList[i]._y2 == iGameMove._y2)
		{
			return true;
		}
	}

	return false;
}


